In [13]:
%matplotlib inline
from compare_bmp import compare_images
from PIL import Image, ImageFilter
from matplotlib.pyplot import imshow
We'll start with this image:
In [18]:
imgpath = 'images/original/image.bmp'
blurredpath = 'images/image_blurred.bmp'
img = Image.open(imgpath)
blurred = img.copy().filter(ImageFilter.BLUR)
blurred.save(blurredpath)
And here it is now that we've blurred it:
Now, let's compare the two to see what kind of error rates we can expect:
In [19]:
[red_flipped, green_flipped, blue_flipped] = compare_images(imgpath, blurredpath)
It looks like we can expect (in this scenario) a worst-case of about 50% of the image's least significant bits to be flipped.